﻿namespace HZY.Core.ApplicationServices;

/// <summary>
/// 服务父类
/// </summary>
[Component]
public abstract class ApplicationService(IServiceProvider serviceProvider)
    : IAopServiceProvider //: ITransientSelfDependency
{
    public IServiceProvider ServiceProvider { get; set; } = serviceProvider;
}

/// <summary>
/// 服务父类
/// </summary>
/// <typeparam name="TEntity">数据库实体</typeparam>
public abstract class ApplicationService<TEntity>(IServiceProvider serviceProvider)
    : ApplicationService(serviceProvider) where TEntity : class, new()
{
    /// <summary>
    /// 默认仓储
    /// </summary>
    [Autowired]
    protected IRepository<TEntity> Repository { get; } = null!;
}